﻿imports System.Text 
Public Class clsvi_GetTrusteeRow
	inherits ADODBU.RowClass
	Private mVar_Mod_Group As System.String
	Private mVar_Mod_ID As System.String
	Private mVar_Parent_ID As System.String
	Private mVar_Mod_Name As System.String
	Private mVar_Mod_Desc As System.String
	Private mVar_Mod_URL As System.String
	Private mVar_User_names As System.String
	Private mVar_Kd_User As System.String
	Private mVar_Mod_Img As System.String
	Private mVar_APP_ID As System.String
	Private mVar_Mod_Key As System.String
	Private mVar_Mod_ImgURL As System.String
	Private mVar_Parent_Group As System.String
	Private mVar_Mod_Type As System.Int32
    Private mVar_Mod_Row As System.Int32
    Private mVar_Aktif As System.Int32
	Private mVar_DirtyMod_Group As Boolean=false 
	Private mVar_DirtyMod_ID As Boolean=false 
	Private mVar_DirtyParent_ID As Boolean=false 
	Private mVar_DirtyMod_Name As Boolean=false 
	Private mVar_DirtyMod_Desc As Boolean=false 
	Private mVar_DirtyMod_URL As Boolean=false 
	Private mVar_DirtyUser_names As Boolean=false 
	Private mVar_DirtyKd_User As Boolean=false 
	Private mVar_DirtyMod_Img As Boolean=false 
	Private mVar_DirtyAPP_ID As Boolean=false 
	Private mVar_DirtyMod_Key As Boolean=false 
	Private mVar_DirtyMod_ImgURL As Boolean=false 
	Private mVar_DirtyParent_Group As Boolean=false 
	Private mVar_DirtyMod_Type As Boolean=false 
    Private mVar_DirtyMod_Row As Boolean = False
    Private mVar_DirtyAktif As Boolean = False
	Private mIsOnInit as Boolean 
	PUBLIC DataSource as ADODBU.Recordset 
	Public RowOrigin As clsvi_GetTrusteeRow
''[------------------------------------------------------------------------]'
	Public Sub New()
	RowOrigin=new clsvi_GetTrusteeRow(true)
	End Sub
''[------------------------------------------------------------------------]'
	Friend Sub New(lCut as boolean)
	 '--- untuk memutus loop reference 
	End Sub
	        ''[------------------------------------------------------------------------]'
	        ''' <summary>
	        ''' create new this class from inherited of this class or its self
	        ''' </summary>
	        ''' <param name="recdataRow"></param>
	        ''' <remarks></remarks>
	    Public Sub New(ByVal recdataRow As ADODBU.RowClass)
	        RowOrigin = New clsvi_GetTrusteeRow(True)
	        me.JoinValue(recdataRow)
	    End Sub
''[------------------------------------------------------------------------]'
	Public Sub New(recData as  ADODBU.Recordset)
	RowOrigin=new clsvi_GetTrusteeRow(true)
		DataSource = recData 
		try 
		InitVar( recdata.GetCurrentDataRow)
		Catch 
		end Try
	End Sub
 
''[------------------------------------------------------------------------]'
	Public Sub New(recdataRow as  DataRow)
	RowOrigin=new clsvi_GetTrusteeRow(true)
		InitVar( recdataRow)
	End Sub
 
#Region "Initialize vars "
''[------------------------------------------------------------------------]'
	private Sub InitVar(Fields as  DataRow)
		Try
			 mVar_Mod_Group = Fields("Mod_Group")
			 RowOrigin.Mod_Group = mVar_Mod_Group 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_ID = Fields("Mod_ID")
			 RowOrigin.Mod_ID = mVar_Mod_ID 
		Catch e as Exception
		End Try
		Try
			 mVar_Parent_ID = Fields("Parent_ID")
			 RowOrigin.Parent_ID = mVar_Parent_ID 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Name = Fields("Mod_Name")
			 RowOrigin.Mod_Name = mVar_Mod_Name 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Desc = Fields("Mod_Desc")
			 RowOrigin.Mod_Desc = mVar_Mod_Desc 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_URL = Fields("Mod_URL")
			 RowOrigin.Mod_URL = mVar_Mod_URL 
		Catch e as Exception
		End Try
		Try
			 mVar_User_names = Fields("User_names")
			 RowOrigin.User_names = mVar_User_names 
		Catch e as Exception
		End Try
		Try
			 mVar_Kd_User = Fields("Kd_User")
			 RowOrigin.Kd_User = mVar_Kd_User 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Img = Fields("Mod_Img")
			 RowOrigin.Mod_Img = mVar_Mod_Img 
		Catch e as Exception
		End Try
		Try
			 mVar_APP_ID = Fields("APP_ID")
			 RowOrigin.APP_ID = mVar_APP_ID 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Key = Fields("Mod_Key")
			 RowOrigin.Mod_Key = mVar_Mod_Key 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_ImgURL = Fields("Mod_ImgURL")
			 RowOrigin.Mod_ImgURL = mVar_Mod_ImgURL 
		Catch e as Exception
		End Try
		Try
			 mVar_Parent_Group = Fields("Parent_Group")
			 RowOrigin.Parent_Group = mVar_Parent_Group 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Type = Fields("Mod_Type")
			 RowOrigin.Mod_Type = mVar_Mod_Type 
		Catch e as Exception
		End Try
		Try
			 mVar_Mod_Row = Fields("Mod_Row")
			 RowOrigin.Mod_Row = mVar_Mod_Row 
		Catch e as Exception
        End Try
        Try
            mVar_Aktif = Fields("Aktif")
            RowOrigin.mVar_Aktif = mVar_Aktif
        Catch e As Exception
        End Try
	End Sub
 
 
#End Region 
''[------------------------------------------------------------------------]'
#Region "Properties"
		Public Property Mod_Group As System.String
			Get
				Return mVar_Mod_Group
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_Group= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Group")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Group= True
				End if 
			End Set
		End Property
		Public Property Mod_ID As System.String
			Get
				Return mVar_Mod_ID
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_ID= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_ID")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_ID= True
				End if 
			End Set
		End Property
		Public Property Parent_ID As System.String
			Get
				Return mVar_Parent_ID
			End Get
			Set(ByVal Value As System.String )
				mVar_Parent_ID= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Parent_ID")) 
				IF Not mIsOnInit then 
					mVar_DirtyParent_ID= True
				End if 
			End Set
		End Property
		Public Property Mod_Name As System.String
			Get
				Return mVar_Mod_Name
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_Name= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Name")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Name= True
				End if 
			End Set
		End Property
		Public Property Mod_Desc As System.String
			Get
				Return mVar_Mod_Desc
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_Desc= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Desc")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Desc= True
				End if 
			End Set
		End Property
		Public Property Mod_URL As System.String
			Get
				Return mVar_Mod_URL
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_URL= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_URL")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_URL= True
				End if 
			End Set
		End Property
		Public Property User_names As System.String
			Get
				Return mVar_User_names
			End Get
			Set(ByVal Value As System.String )
				mVar_User_names= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("User_names")) 
				IF Not mIsOnInit then 
					mVar_DirtyUser_names= True
				End if 
			End Set
		End Property
		Public Property Kd_User As System.String
			Get
				Return mVar_Kd_User
			End Get
			Set(ByVal Value As System.String )
				mVar_Kd_User= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Kd_User")) 
				IF Not mIsOnInit then 
					mVar_DirtyKd_User= True
				End if 
			End Set
		End Property
		Public Property Mod_Img As System.String
			Get
				Return mVar_Mod_Img
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_Img= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Img")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Img= True
				End if 
			End Set
		End Property
		Public Property APP_ID As System.String
			Get
				Return mVar_APP_ID
			End Get
			Set(ByVal Value As System.String )
				mVar_APP_ID= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("APP_ID")) 
				IF Not mIsOnInit then 
					mVar_DirtyAPP_ID= True
				End if 
			End Set
		End Property
		Public Property Mod_Key As System.String
			Get
				Return mVar_Mod_Key
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_Key= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Key")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Key= True
				End if 
			End Set
		End Property
		Public Property Mod_ImgURL As System.String
			Get
				Return mVar_Mod_ImgURL
			End Get
			Set(ByVal Value As System.String )
				mVar_Mod_ImgURL= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_ImgURL")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_ImgURL= True
				End if 
			End Set
		End Property
		Public Property Parent_Group As System.String
			Get
				Return mVar_Parent_Group
			End Get
			Set(ByVal Value As System.String )
				mVar_Parent_Group= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Parent_Group")) 
				IF Not mIsOnInit then 
					mVar_DirtyParent_Group= True
				End if 
			End Set
		End Property
		Public Property Mod_Type As System.Int32
			Get
				Return mVar_Mod_Type
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_Mod_Type= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Type")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Type= True
				End if 
			End Set
		End Property
		Public Property Mod_Row As System.Int32
			Get
				Return mVar_Mod_Row
			End Get
			Set(ByVal Value As System.Int32 )
				mVar_Mod_Row= Value 
				Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Mod_Row")) 
				IF Not mIsOnInit then 
					mVar_DirtyMod_Row= True
				End if 
			End Set
    End Property
    Public Property Aktif() As System.Int32
        Get
            Return mVar_Aktif
        End Get
        Set(ByVal Value As System.Int32)
            mVar_Aktif = Value
            Me.OnPropertyChanged(New System.ComponentModel.PropertyChangedEventArgs("Aktif"))
            If Not mIsOnInit Then
                mVar_DirtyAktif = True
            End If
        End Set
    End Property
		Public ReadOnly Property Mod_GroupIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Group
			End Get
		End Property
		Public ReadOnly Property Mod_IDIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_ID
			End Get
		End Property
		Public ReadOnly Property Parent_IDIsDirty As Boolean 
			Get
				Return mVar_DirtyParent_ID
			End Get
		End Property
		Public ReadOnly Property Mod_NameIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Name
			End Get
		End Property
		Public ReadOnly Property Mod_DescIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Desc
			End Get
		End Property
		Public ReadOnly Property Mod_URLIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_URL
			End Get
		End Property
		Public ReadOnly Property User_namesIsDirty As Boolean 
			Get
				Return mVar_DirtyUser_names
			End Get
		End Property
		Public ReadOnly Property Kd_UserIsDirty As Boolean 
			Get
				Return mVar_DirtyKd_User
			End Get
		End Property
		Public ReadOnly Property Mod_ImgIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Img
			End Get
		End Property
		Public ReadOnly Property APP_IDIsDirty As Boolean 
			Get
				Return mVar_DirtyAPP_ID
			End Get
		End Property
		Public ReadOnly Property Mod_KeyIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Key
			End Get
		End Property
		Public ReadOnly Property Mod_ImgURLIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_ImgURL
			End Get
		End Property
		Public ReadOnly Property Parent_GroupIsDirty As Boolean 
			Get
				Return mVar_DirtyParent_Group
			End Get
		End Property
		Public ReadOnly Property Mod_TypeIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Type
			End Get
		End Property
		Public ReadOnly Property Mod_RowIsDirty As Boolean 
			Get
				Return mVar_DirtyMod_Row
			End Get
    End Property
    Public ReadOnly Property AktifIsDirty() As Boolean
        Get
            Return mVar_DirtyAktif
        End Get
    End Property
#End Region 
''[------------------------------------------------------------------------]'
	Public Function SaveToDataSource() as string
		dim msgErr as string 
		msgErr ="" 
		if mVar_DirtyMod_Group then 
		Try
			 DataSource.Fields("Mod_Group") =  mVar_Mod_Group 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_ID then 
		Try
			 DataSource.Fields("Mod_ID") =  mVar_Mod_ID 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyParent_ID then 
		Try
			 DataSource.Fields("Parent_ID") =  mVar_Parent_ID 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Name then 
		Try
			 DataSource.Fields("Mod_Name") =  mVar_Mod_Name 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Desc then 
		Try
			 DataSource.Fields("Mod_Desc") =  mVar_Mod_Desc 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_URL then 
		Try
			 DataSource.Fields("Mod_URL") =  mVar_Mod_URL 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyUser_names then 
		Try
			 DataSource.Fields("User_names") =  mVar_User_names 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyKd_User then 
		Try
			 DataSource.Fields("Kd_User") =  mVar_Kd_User 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Img then 
		Try
			 DataSource.Fields("Mod_Img") =  mVar_Mod_Img 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyAPP_ID then 
		Try
			 DataSource.Fields("APP_ID") =  mVar_APP_ID 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Key then 
		Try
			 DataSource.Fields("Mod_Key") =  mVar_Mod_Key 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_ImgURL then 
		Try
			 DataSource.Fields("Mod_ImgURL") =  mVar_Mod_ImgURL 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyParent_Group then 
		Try
			 DataSource.Fields("Parent_Group") =  mVar_Parent_Group 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Type then 
		Try
			 DataSource.Fields("Mod_Type") =  mVar_Mod_Type 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
		End if
		 
		if mVar_DirtyMod_Row then 
		Try
			 DataSource.Fields("Mod_Row") =  mVar_Mod_Row 
		Catch e as Exception
			msgErr=msgErr & e.Message  
		End Try
        End If

        If mVar_DirtyAktif Then
            Try
                DataSource.Fields("Aktif") = mVar_Aktif
            Catch e As Exception
                msgErr = msgErr & e.Message
            End Try
        End If
		 
		return msgErr 
	End function
 
''[------------------------------------------------------------------------]'
	Public Sub ClearDirty
		 mVar_DirtyMod_Group = false
		 mVar_DirtyMod_ID = false
		 mVar_DirtyParent_ID = false
		 mVar_DirtyMod_Name = false
		 mVar_DirtyMod_Desc = false
		 mVar_DirtyMod_URL = false
		 mVar_DirtyUser_names = false
		 mVar_DirtyKd_User = false
		 mVar_DirtyMod_Img = false
		 mVar_DirtyAPP_ID = false
		 mVar_DirtyMod_Key = false
		 mVar_DirtyMod_ImgURL = false
		 mVar_DirtyParent_Group = false
		 mVar_DirtyMod_Type = false
        mVar_DirtyMod_Row = False
        mVar_DirtyAktif = False
	End Sub
''[------------------------------------------------------------------------]'
	Public Sub SetDirty
		 mVar_DirtyMod_Group = true
		 mVar_DirtyMod_ID = true
		 mVar_DirtyParent_ID = true
		 mVar_DirtyMod_Name = true
		 mVar_DirtyMod_Desc = true
		 mVar_DirtyMod_URL = true
		 mVar_DirtyUser_names = true
		 mVar_DirtyKd_User = true
		 mVar_DirtyMod_Img = true
		 mVar_DirtyAPP_ID = true
		 mVar_DirtyMod_Key = true
		 mVar_DirtyMod_ImgURL = true
		 mVar_DirtyParent_Group = true
		 mVar_DirtyMod_Type = true
        mVar_DirtyMod_Row = True
        mVar_DirtyAktif = True
	End Sub

End Class
